package com.newly.center.business.api;

import com.newly.api.business.feign.MQTTBlackListClient;
import com.newly.center.business.service.MQTTBlackListService;
import com.newly.common.base.annotation.NewlyLog;
import com.newly.common.base.constants.MenuConstant;
import com.newly.common.base.constants.ServerUriConstant;
import com.newly.common.base.entity.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(ServerUriConstant.NEWLY_BUSINESS_MQTT_BlackList)
public class MQTTBlackListController implements MQTTBlackListClient {

    @Autowired
    MQTTBlackListService MQTTBlackListService;

    @NewlyLog(ability = MenuConstant.Ability.QUE, title = "黑名单", isOpen = false)
    @Override
    public R getBlackList(String productKey, int start, int limit) {
        return MQTTBlackListService.getBlackList(productKey,start,limit);
    }

    @NewlyLog(ability = MenuConstant.Ability.UPD, title = "黑名单", isOpen = true)
    @Override
    public R modifyBlackList(String productKey,int index,String plateNo) {
        return MQTTBlackListService.modifyBlackList(productKey,index,plateNo);
    }

    @NewlyLog(ability = MenuConstant.Ability.DEL, title = "黑名单", isOpen = true)
    @Override
    public R deleteBlackList(String productKey,int index) {
        return MQTTBlackListService.deleteBlackList(productKey,index);
    }

    @NewlyLog(ability = MenuConstant.Ability.ADD, title = "黑名单", isOpen = true)
    @Override
    public R addBlackList(String productKey,String[] plate) {
        return MQTTBlackListService.addBlackList(productKey,plate);
    }
}
